﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Lapkin.Models.DataModels
{
    public class ProductVariant
    {
        [Key]
        public Guid Id { get; set; }

        public String Name { get; set; }

        public virtual ICollection<ProductVariantProduct> Products { get; set; }
    }

    public class ProductVariantProduct
    {
        [Key, Column(Order = 0)]
        public Guid ProductId { get; set; }
        [Key, Column(Order = 1)]
        public Guid VariantId { get; set; }

        public virtual ProductVariant Variant { get; set; }
        public virtual Product Product { get; set; }

        public virtual ICollection<ProductVariantValue> Values { get; set; }
    }

    public class ProductVariantValue
    {
        [Key]
        public Guid Id { get; set; }
        public String Value { get; set; }
        public Decimal Discount { get; set; }

        public virtual ProductVariantProduct ProductVariantProduct { get; set; }
    }
}